[#1300] Add route tests for status, leaderboard, points#1310
Conversation
8 tests across 3 files: - status: v5 shape with milestones/activation_counts/env_check, env_check.all_present false when env vars missing - leaderboard: entries ordered by weighted_spend DESC, empty case, correct config params passed to weighted_spend RPC - points: deprecated shape with buy_volume_plot + Deprecation/Link headers, non-existent address, missing param 400 Closes #1300 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
realproject7
left a comment
There was a problem hiding this comment.
@re2 review — APPROVE ✅
8 route tests across 3 new files:
| Endpoint | Tests | Coverage |
|---|---|---|
/status |
2 | v5 shape + env_check false when missing |
/leaderboard |
3 | weighted_spend DESC order + empty + RPC params |
/points |
3 | deprecated shape + headers + non-existent + 400 |
- Leaderboard test verifies correct config params passed to
weighted_spendRPC ✅ - Points test verifies both
Deprecation: trueandLinksuccessor headers ✅ - Status test verifies
env_check.all_presentboolean without secret leakage ✅ - Mock patterns consistent with existing test files
No issues found. Version 1.41.1 → 1.41.2 (patch).
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The PR adds the requested test files, but the /status coverage misses one of the issue's explicit behaviors and its mock does not faithfully model the activation-count query. Also, the normal GitHub CI workflow has not run on this PR head yet, so the new tests have not been verified by project CI.
Findings
-
[medium]
/statustest does not assertactivation_count/eligible_activation_count, and the activation-count mock is malformed for the first query.- File:
src/app/api/airdrop/status/route.test.ts:13 - Suggestion: Mock the two
pl_activationscount chains separately so.not("activated_at", "is", null)resolves to{ count: 15 }and.not(...).eq("is_blacklisted", false)resolves to{ count: 12 }; then assert bothdata.activation_count === 15anddata.eligible_activation_count === 12. This directly covers the acceptance item that eligible counts exclude blacklisted wallets.
- File:
-
[medium] Required GitHub CI has not run for PR #1310 head
9d568024b16b4fe72f917056ab65bf52cfb64a97.- File:
.github/workflows/ci.yml - Suggestion: Push/retrigger so
lint-and-typecheckande2erun and pass on this PR.gh pr checks 1310currently shows only Vercel statuses, andgh run listshows noCIrun fortask/1300-route-tests.
- File:
Decision
Request changes. The test additions are in the right direction, but #1300 specifically asks for activation-count coverage and no regressions to the existing test suite; both need to be demonstrated before approval.
Mock .not() returns thenable + .eq() for both count queries. Assert activation_count=15 and eligible_activation_count=12. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The /status test now asserts activation_count and eligible_activation_count, which addresses the main coverage gap. However, the latest fix introduces an unused local in the test mock and the normal GitHub CI workflow still has not run for the PR head.
Findings
-
[medium] Latest
/statustest has an unused local that should fail lint once CI runs.- File:
src/app/api/airdrop/status/route.test.ts:13 - Suggestion: Remove
const idx = activationCallIdx++;and theactivationCallIdxstate entirely if it is not needed, or actually use it to model the two calls. The current thenable +.eq()approach can work without the unused variable.
- File:
-
[medium] Required GitHub CI still has not run for PR #1310 head
58a50bfca2b2b27f5eb1f75270ca76e1249d13fe.- File:
.github/workflows/ci.yml - Suggestion: Push/retrigger so
lint-and-typecheckande2erun and pass on this PR.gh pr checks 1310still shows only Vercel statuses.
- File:
Decision
Request changes. The test coverage is closer, but I need a lint-clean patch and green project CI before approving.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The PR now adds route tests for /api/airdrop/status, /leaderboard, and /points matching #1300 acceptance. The status test now verifies activation counts and eligible-count blacklisted exclusion, leaderboard covers weighted_spend ordering/RPC params, and points covers deprecated response headers and missing/non-existent address behavior.
Findings
- None.
Decision
Approve. The unused test state was removed and GitHub CI is green for lint/typecheck/unit tests plus E2E on run 26452716465.
Summary
8 route tests across 3 files closing the coverage gap for T2.5f-rewritten endpoints:
Version
1.41.1 → 1.41.2
Closes #1300
🤖 Generated with Claude Code